-- @owner: z@wan005
-- @date: 2022-02-16
-- @testpoint: clob类型支持出现在where条件中，并且超过64k
--step1:创建函数;expect:成功
drop function if exists f_clob_0011;
create function f_clob_0011(length integer) returns character varying
language plpgsql
as $$
declare
result varchar(65000);
begin
select array_to_string(array(select chr((65 + round(random() * 25)) :: integer)
from generate_series(1,length)), '/') into result;
return result;
end
$$;
/
--step2:建表;expect:成功
drop table if exists tb_clob_0011;
create table tb_clob_0011(id int,c_clob clob) with (storage_type=ustore);
insert into tb_clob_0011 values(1,f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500)||f_clob_0011(7500));
--step3:查询;expect:成功
select length(c_clob) from tb_clob_0011;
select * from tb_clob_0011 where c_clob = f_clob_0011(7500);
--step4:清理环境;expect:成功
drop table if exists tb_clob_0011;
drop function if exists f_clob_0011;








